package Day2;

import java.util.Scanner;
// 1:无需package
// 2: 类名必须Main, 不可修改
/**
 * 2020JavaB真题: 跑步锻炼
 * https://www.lanqiao.cn/problems/597/learning/?problem_list_id=2&page=1
 */
public class Main2 {
    public static void main(String[] args) {
      int year = 2000;
      int[] month={0,31,28,31,30,31,30,31,31,30,31,30,31};
      int mon = 1;
      int day = 1;
      int weekday = 6;
      int sum = 0;
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        while(true){
          //判断是否为闰年
          if(year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)){
            month[2] = 29;
          }else{
            month[2] = 28;
          }

          //如果是每月第一天或者周一
          if(day == 1 || weekday == 1){
            sum += 2;
          }else{
            sum += 1;
          }
          
          //到下一天
          day++;
          weekday++;

          //重置天数和更新月份
          if(day > month[mon]){
            day = 1;
            mon++;
          }
          //重置月份和更新年份
          if(mon > 12){
            mon = 1;
            year++;
          }
          
          //更新周几
          if(weekday > 7){
            weekday = 1;
          }
          
          //跳出循环
          if(year == 2020 && mon == 10 && day == 1){
            sum += 2;
            break;
          }

        }

        System.out.println(sum);
        scan.close();
    }
}